package com.lwy.qiuchao.integration.controller;


import java.util.Map;

import com.lwy.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.lwy.qiuchao.integration.service.IntegrationService;

/**
 * 
 *
 * @author lwy
 * @email ${email}
 * @date 2020-12-01 15:34:10
 */
@RestController
@RequestMapping("integration/integration")
public class IntegrationController {
    @Autowired
    private IntegrationService integrationService;

    /**
     * 通过会员id查询 积分
     *
     * 参数 memberId
     * */
    @RequestMapping("/intevalue")
    public R getInteBymid(@RequestParam Map<String,Object> params){
        Integer intevalue = integrationService.getInteBymid(params);
        return R.ok().put("data",intevalue);
    }

    /**
     * 通过会员id 修改使用的积分
     *
     *  参数 memberId totalValue
     * */
    @RequestMapping("/useintevalue")
    public void useIntevalue(@RequestParam Map<String,Object> params){
        integrationService.useIntevalue(params);
    }

}
